package cn.com.qingz.modules.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;

import cn.com.qingz.core.model.EasyUITree;
import cn.com.qingz.modules.user.model.Category;
import cn.com.qingz.modules.user.vo.CategorySearchCondition;
import tk.mybatis.mapper.common.Mapper;

public interface CategoryMapper extends Mapper<Category> {

    public PageList<Category> queryForPage(CategorySearchCondition condtion, PageBounds pageBounds);


    @Select("select categoryid  as id,title as text from category where parentId = #{pid}")
    public List<EasyUITree>  findChildrenByPid(@Param("pid") String  pid);

    @Select("select *  from category where title = #{title} limit 0,1")
    public Category findByName(@Param("title") String title);

}
